package main

import "fmt"
import "net/http"

func main() {
	resp, err := http.Get("https://www.cet.com.cn/")
	if err != nil {
		fmt.Println("没找到此网页")
		return
	}
	defer resp.Body.Close()
	fmt.Println("Status=", resp.Status)
	fmt.Println("StatusCode=", resp.StatusCode)
	fmt.Println("Header=", resp.Header)
	buf := make([]byte, 1024)
	var tmp string
	for {
		n, err := resp.Body.Read(buf)
		if n == 0 {
			fmt.Println("reading error=", err)
			break
		}
		tmp += string(buf[:n])
	}
	fmt.Println("tmp=", tmp)

}
